<!DOCTYPE html>
<html>
<head>
    <title>API测试</title>
    <script src="js/jquery.min.js"></script>
</head>
<body>
    <h1>API测试</h1>
    <div id="result"></div>
    <script>
        $(document).ready(() => {
            // 测试图书API
            fetch('http://localhost:8080/api/books')
                .then(response => response.json())
                .then(data => {
                    $('#result').html('API连接成功：' + JSON.stringify(data));
                })
                .catch(error => {
                    $('#result').html('API连接失败：' + error.message);
                    console.error('Error:', error);
                });
        });
    </script>
</body>
</html> 